'''
    1.对开户模块相关的接口进行封装
'''
import app


class OpenAccountApi:

    def __init__(self, session):
        self.session = session
        self.url_realname = app.BASE_HOST + "/member/realname/approverealname"
        self.url_query_realname_info = app.BASE_HOST + "/member/member/getapprove"
        self.url_open_account = app.BASE_HOST + "/trust/trust/register"

    # 实名认证接口
    def realname(self, realname, card_id):
        # 定义字典变量，用来接收请求体数据
        data_mul = {"realname": realname, "card_id": card_id}
        return self.session.post(url=self.url_realname, data=data_mul, files={"x": "y"})

    # 查询实名认证接口
    def query_realname_info(self):
        return self.session.post(url=self.url_query_realname_info)

    # 开户接口
    def open_account(self):
        return self.session.post(url=self.url_open_account)

    # 第三方开户接口
    def third_open_account(self, url, data_dict):
        return self.session.post(url=url,data=data_dict)
